# Carbon Jiao <http://archlive-pkg.googlecode.com>
pkgname=fcitx-svn-mini
pkgver=258
pkgrel=1
url=http://code.google.com/p/fcitx
pkgdesc="fcitx mini, just have pinyin, wubi, erbi"
arch=('i686' 'x86_64')
license=('GPL')
depends=('libxft' 'libxpm')
makedepends=('automake' 'gettext' 'libxtst' 'xextproto')
provides=('fcitx-svn')
replaces=('fcitx-svn')
source=(config tables.conf)

_svntrunk=http://fcitx.googlecode.com/svn/trunk
_svnmod=fcitx-svn

build() {
	## start building
	cd $srcdir/	
	if [ -d $_svnmod ]; then
		cd $svnmod && svn up
	else
		svn co $_svntrunk $_svnmod
	fi
	msg "SVN checkout done or server timeout"

	msg "Starting make..."
	cd $srcdir
	[ -d ${_svnmod}-build ] && rm -rf ${_svnmod}-build
	cp -r $_svnmod ${_svnmod}-build
	cd $srcdir/${_svnmod}-build
	./autogen.sh
	./configure --prefix=/usr --enable-xft
	make || return 1
	#make DESTDIR=$pkgdir install || return 1
	install -Dm755 $srcdir/$_svnmod-build/src/fcitx $pkgdir/bin/fcitx
	mkdir -p $pkgdir/usr/share/fcitx/data
	cp $srcdir/$_svnmod-build/data/{AutoEng.dat,gbks2t.tab,punc.mb,pybase.mb,pyphrase.mb,pySym.mb,sp.dat,vk.conf,wbx.mb} \
         $pkgdir/usr/share/fcitx/data/
	cp $srcdir/{config,tables.conf} $pkgdir/usr/share/fcitx/data/
	cp -r $srcdir/$_svnmod-build/xpm $pkgdir/usr/share/fcitx/xpm
	rm -rf $pkgdir/usr/share/fcitx/xpm/{.svn,Make*}
}
